Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ign -> gz Migrate Internal CMake Vars : gz-cmake #275

Closed
wants to merge 9 commits into from

Conversation

methylDragon
Copy link
Contributor

@methylDragon methylDragon commented Jul 9, 2022

See: gazebo-tooling/release-tools#698

Built on top of: #274

In an effort to keep track of what has already been tick-tocked, I placed the Deprecated. comment (in most cases) on the same line so it appears on grep.

Try it: grep -ri set\(ign

BREAKING NOTES

  • IGNITION_DOXYGEN_TAGFILES is set by DOWNSTREAM libraries and used in this UPSTREAM library... I am just going to hard-tock it and remember to update the downstream usage since it's just for docs...
    • This won't lead to a compile error, but will lead to malformed docs until the downstream libraries are tocked.

The next few ones look like they're breaking (because they change the install path to gz), but local builds work.
Release repos might need to be updated to have the topline ignition -> gz.

  • Change default include directory from include/ignition to include/gz (I think in GzConfigureBuild.cmake and GzPackaging.cmake?)
  • PROJECT_INCLUDE_DIR stores ignition/${IGN_DESIGNATION} -> gz/...
    • This would be breaking, but all downstream uses actually bypass this block, so I think it's safe to adjust, I think
    • This crucially changes the install directory to gz instead of ignition, likely necessitating release repository changes, but no other issues if packages are rebuilt accordingly

See: e1c4a35

Pending??

Hard-Tocks

Usually because they're internal or aren't used anywhere else in the entire Gz stack

  • GitHub workflow targets

  • Erm.. docs only mentions?

    • IGN_SANITIZERS
    • USE_IGN_RECOMMENDED_FLAGS
  • GzCodeCoverage.cmake:

    • IGN_SETUP_TARGET_FOR_COVERAGE
  • Top level gz-cmake CMakeLists.txt

    • ign_pkgconfig_xxx
    • ign_utilities_xxx
    • IGN_PC_CONFIG_RELATIVE_PATH_TO_PREFIX
  • GzPackaging.cmake:

    • IGNITION_CMAKE_DIR
    • IGNITION_CMAKE_VERSION_MAJOR
  • GzCreateDocs.cmake

    • IGNITION_DOXYGEN_GENTAGFILE
    • IGNITION_DOXYGEN_INPUT
    • IGNITION_DOXYGEN_IMAGE_PATH
    • IGNITION_DOXYGEN_API_MAINPAGE_MD
    • IGNITION_DOXYGEN_GENHTML
    • IGNITION_DOXYGEN_AUTOGENERATED_DOC
    • IGNITION_DOXYGEN_TUTORIALS_MAINPAGE_MD
    • IGNITION_DOXYGEN_TUTORIALS_DIR
    • IGNITION_DOXYGEN_ADDITIONAL_INPUT_DIRS
  • GzRonn2Man.cmake

    • ign_add_manpage_target
  • gz-config.cmake.in

    • set_and_check(@PKG_NAME@_INCLUDE_DIRS "@PACKAGE_IGN_INCLUDE_INSTALL_DIR_FULL@") this is the only occurance of that IGN variable. I don't know why

Tick-Tocks

  • Every variable that is set with an IGNITION/IGN prefix, generally in .cmake files which are meant to be included (internal references hard-tocked, but the set call itself is ticktocked.)

  • gz-cmake-config.cmake.in:

    • IGN_INCLUDE_INSTALL_DIR_FULL
    • IGNITION_CMAKE_VERSION_MAJOR
    • IGNITION_CMAKE_DOXYGEN_DIR (Also in top level CMakeLists.txt... it's confusing, I know)
    • IGNITION_CMAKE_CODECHECK_DIR
    • IGNITION_CMAKE_BENCHMARK_DIR
    • IGNITION_CMAKE_TOOLS_DIR
  • All these IGN_DESIGNATION variables...

    • IGN_DESIGNATION
    • IGN_DESIGNATION_LOWER
    • IGN_DESIGNATION_UPPER
    • IGN_DESIGNATION_FIRST_LETTER
    • IGN_DESIGNATION_CAP
  • GzPackaging.cmake:

    • IGN_INCLUDE_INSTALL_DIR
    • IGN_INCLUDE_INSTALL_DIR_POSTFIX
    • IGN_INCLUDE_INSTALL_DIR_FULL
    • IGN_DATA_INSTALL_DIR_POSTFIX
    • IGN_DATA_INSTALL_DIR
    • IGN_LIB_INSTALL_DIR
    • IGN_BIN_INSTALL_DIR
  • GzConfigureBuild.cmake

    • IGN_CXX_XXX
    • IGN_KNOWN_CXX_STANDARDS
    • CMakeLists.txt search path now prioritizes gz over ignition
  • GzSetCompilerFlags.cmake

    • IGN_ADD_fPIC_TO_LIBRARIES
    • IGN_USE_STATIC_RUNTIME (option and cache variable)
  • GzPython.cmake

    • IGN_PYTHON_VERSION
  • Hmhm

    • REPLACE_IGNITION_INCLUDE_PATH
    • NO_IGNITION_PREFIX

@github-actions github-actions bot added the 🌱 garden Ignition Garden label Jul 9, 2022
@methylDragon methylDragon force-pushed the migrate_cmake_vars branch 7 times, most recently from e1c4a35 to a1065a1 Compare July 11, 2022 07:44
@methylDragon methylDragon marked this pull request as ready for review July 11, 2022 07:46
@chapulina chapulina added the ign to gz Renaming Ignition to Gazebo. label Jul 11, 2022
@chapulina chapulina self-requested a review July 11, 2022 15:14
cmake/GzConfigureProject.cmake Outdated Show resolved Hide resolved
cmake/GzConfigureProject.cmake Outdated Show resolved Hide resolved
@methylDragon
Copy link
Contributor Author

This PR can be squashed

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review so far

Migration.md Outdated Show resolved Hide resolved
tools/doc_check.sh Show resolved Hide resolved
cmake/GzSanitizers.cmake Show resolved Hide resolved
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished doing a pass on the code, still need to test locally with other libraries

@@ -43,3 +43,6 @@ endif()
if(Python3_EXECUTABLE AND NOT PYTHON_EXECUTABLE)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()

set(IGN_PYTHON_VERSION ${GZ_PYTHON_VERSION} CACHE STRING # TODO(CH3): Deprecated. Remove on tock.
"Deprecated. Use [GZ_PYTHON_VERSION] instead! Specify specific Python version to use ('major.minor' or 'major')")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be up top?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake/GzPython.cmake Outdated Show resolved Hide resolved
# part of a plugin-based framework.
option(IGN_USE_STATIC_RUNTIME "Use the static runtime (strongly discouraged)" OFF)

if(IGN_USE_STATIC_RUNTIME) # TODO(CH3): Deprecated. Remove on tock.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the option() line before checking if it's set?

Copy link
Contributor Author

@methylDragon methylDragon Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option will create a cache variable which can then be set via CLI, if I'm not wrong, so that's why I think having the option there is necessary

if(BUILD_SHARED_LIBS)
# Users should not choose the static runtime unless they are compiling a
# static library, so we completely disable this option if BUILD_SHARED_LIBS
# is turned on.
set(IGN_USE_STATIC_RUNTIME OFF CACHE BOOL "Use the static runtime (strongly discouraged)" FORCE)
set(GZ_USE_STATIC_RUNTIME OFF CACHE BOOL "Use the static runtime (strongly discouraged)" FORCE)
set(IGN_USE_STATIC_RUNTIME ${GZ_USE_STATIC_RUNTIME} # TODO(CH3): Deprecated. Remove on tock.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this is internally setting the variable. So we should only need to set GZ_ and use that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: methylDragon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden ign to gz Renaming Ignition to Gazebo.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants